/****************************************************************************
 *  _____       ______  _____
 * |_   _|     |  ____|/ ____|
 *   | |  _ __ | |__  | (___    Institute of Embedded Systems
 *   | | | '_ \|  __|  \___ \   Zürcher Hochschule für Angewandte
 *  _| |_| | | | |____ ____) |  Wissenschaften
 * |_____|_| |_|______|_____/   8401 Winterthur, Switzerland
 *
 ****************************************************************************
 *
 * @version $Rev: 162 $
 * @author  $Author: bacr $
 * @date    $Date: 2013-11-06 09:10:44 +0100 (Mi, 06 Nov 2013) $
 *
 ***************************************************************************/

#ifndef __NET_ADDRESS_HAL_H__
#define __NET_ADDRESS_HAL_H__

#include "packet/net_address.h"

#define MAC_HIGH(mac)                   (((mac)->addr[0] << 24) | ((mac)->addr[1] << 16) | ((mac)->addr[2] << 8)  | ((mac)->addr[3]))
#define MAC_LOW(mac)                    (((mac)->addr[4] << 8)  | ((mac)->addr[5]))

#define MAC_TABLE_HIGH(mac1, mac2)      (((mac1).addr[0] << 24) | ((mac1).addr[1] << 16) | ((mac1).addr[2] << 8) | ((mac1).addr[3]))
#define MAC_TABLE_MIDDLE(mac1, mac2)    (((mac2).addr[0] << 24) | ((mac2).addr[1] << 16) | ((mac1).addr[4] << 8) | ((mac1).addr[5]))
#define MAC_TABLE_LOW(mac1, mac2)       (((mac2).addr[2] << 24) | ((mac2).addr[3] << 16) | ((mac2).addr[4] << 8) | ((mac2).addr[5]))

#endif

